<template>
	<view>
		<NavBar text='就诊记录' @end='end'>
			<template slot='title' v-if="isdortor">
				<!-- <u-icon name='list' size='28rpx' color="#fff"></u-icon> -->
				<view style="color: #fff; font-size: 25rpx;">发起申请</view>
			</template>
		</NavBar>
		<view style="width: 100%; height: 123rpx;"></view>
		<!-- <uni-nav-bar title="慢病信息" background-color="#3e9aff" left-icon="left" color="white" height="60px" @clickLeft="back"></uni-nav-bar> -->
		<view style="margin-bottom: 10px;background-color: #FFF;padding-bottom:20px ;">
			<view style="background-color: white; width: 100vw; display: flex;justify-content:flex-start;">
				<view style="margin-left: 15px;margin-top: 15px;margin-bottom: 10px;">
					<image src="@/static/u783.png" mode="" style="width: 74px;height: 72px;"></image>
				</view>
				<view style="margin-left: 10px;margin-right: 90px;
						 display: flex;flex-direction: column;justify-content: space-between;margin-top: 15px;margin-bottom: 10px;">
					<view class="flx">
						<view style="display: flex;width: 100%;justify-content: space-between;">
							<h4>{{object.name}}</h4>
							<h4 style="color: #cecece;">{{object.sex}}</h4>
							<h4 style="color: #cecece;">{{object.age}}岁</h4>
						</view>
						<h4 style="color:#4891ff; position: absolute; right: 20rpx;">门诊病历</h4>
					</view>

					<view style="color: #afafaf;font-size: 12px;">
						<span>就诊医院：太原市中医院</span>
					</view>
					<view style="color: #afafaf;font-size: 12px;">
						<span>就诊科室：骨科</span>
						<span style="margin-left: 30rpx;">接诊医生: 张小龙</span>
					</view>
					<view style="color: #afafaf;font-size: 12px;">
						<span>就诊时间：2023-02-01 14:22</span>
					</view>
				</view>
			</view>
		</view>

		<view style="width: 100%; background-color: #fff; margin-top:20rpx;">
			<view style="width: 90%; margin:0 auto; line-height: 100rpx; font-size: 30rpx;" class="flx">
				<view style="color: #333;">医生诊断</view>
				<view style="color: #a5a5a5;">斑疹伤寒</view>
			</view>
		</view>

		<view style="width: 100%; background-color: #fff; margin-top:20rpx;">
			<view style="width: 90%; margin:0 auto; line-height: 100rpx; font-size: 30rpx;" class="flx">
				<view style="color: #333;">医生诊断</view>
				<view style="color: #a5a5a5;" class="flx1">
					<view>平时多运动，多吃营养···</view>
					<u-icon name="arrow-right" color="#cecece" size="20"></u-icon>
				</view>
			</view>
		</view>

		<view style="width: 100%; background-color: #fff; margin-top:20rpx;">
			<view
				style="width: 90%; margin:0 auto; line-height: 100rpx; border-bottom: 1rpx solid #cecece; font-size: 30rpx;"
				class="flx">
				<view style="color: #333;">相关处方</view>
			</view>
			<view style="width: 90%; margin: 0 auto;">
				<view v-for="(item,index) in array" :key="index" style="margin-top:40rpx;">
					<view class="flx" style="font-size: 30rpx;">
						<view>处方号：{{item.number}}</view>
						<view>{{item.label}}</view>
					</view>
					<view style="width: 70%; height: 200rpx; margin-top:20rpx;">
						<image style="width: 100%; height: 100%;" src="/static/cf.png"></image>
					</view>
					<view style="font-size: 30rpx; color: #333;">共<span style="color: red;">{{item.money}}</span>元
					</view>
					<view class="flxEnd">
						<view @click="jf(item.status ? 1 : 2)" v-if="item.status != 3"
							style="width: 140rpx; font-size: 20rpx; line-height: 60rpx; text-align: center; border-radius: 30rpx; background-color:#fc8e16; color: #fff;">
							{{item.status ? '续方' : '立即缴费'}}
						</view>
					</view>
					<view class="flxEnd" style="width: 100%; margin-top:20rpx;" v-if="item.status == 1">
						<view style="font-size: 25rpx; color: #4891ff;" @click="ckbg(item.status)">查看报告</view>
					</view>

				</view>
			</view>
		</view>
		<view style="width: 100%; height: 200rpx;"></view>
		<u-modal :show="show" :title="title" :content='content' @confirm="show = !show"></u-modal>
	</view>
</template>

<script>
	import NavBar from '@/components/NarBar.vue'
	export default {
		components: {
			NavBar
		},
		data() {
			return {
				show: false,
				title: '提示',
				content: '确定要进行续方吗？',
				isdortor: true,
				array: [{
						number: '202202031915',
						label: '西药',
						money: '120',
						status: 0
					},
					{
						number: '202304050800',
						label: '西药',
						money: '120',
						status: 1
					},
					{
						number: '202401021009',
						label: '西药',
						money: '120',
						status: 3
					}
				],
				object: {
					name: '张三三',
					sex: '女',
					age: '32'
				}
			}
		},
		onLoad(e) {
			if (e.status == 1) {
				this.isdortor = false
			}
			if (e.datas) {
				console.log(JSON.parse(e.datas));
				this.object = JSON.parse(e.datas)
			}
		},
		methods: {
			end() {
				uni.navigateTo({
					url: '/pages/twowayReferral/Referralrequest'
				})
			},
			ckbg(key) {
				if (key == 1) {
					uni.navigateTo({
						url: '/pages/VisitRecord/ckbgs'
					})
				} else {
					uni.navigateTo({
						url: '/pages/VisitRecord/ckbg'
					})
				}

			},
			jf(e) {
				if (e == 1) {
					this.show = true
				} else {
					uni.navigateTo({
						url: '/pages/OnlineConsultation/ljjf'
					})
				}

			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f7f7f7;
	}

	.zzstyle {
		background-color: #fff;

		.zzstyle_ {
			.zzstyle_text {
				font-size: 30rpx;
				color: #333;
				line-height: 60rpx;
			}

			.zzstyle_text_ {
				font-size: 28rpx;
				color: #a6a6a6;
				line-height: 60rpx;
				margin-left: 20rpx;
			}

			.zzstyle_text_1 {
				font-size: 28rpx;
				color: #a6a6a6;
				line-height: 60rpx;
				margin-left: 10rpx;
			}

			.zzstyle_text_2 {
				font-size: 28rpx;
				color: #a6a6a6;
				line-height: 60rpx;
				margin-left: 30rpx;
			}

			.zzstyle_right {
				font-size: 28rpx;
				color: #0066ff;
				line-height: 60rpx;
			}
		}

		.c-zzstyle {
			line-height: 50rpx;
			font-size: 28rpx;
		}

		.b-zzstyle {
			font-size: 28rpx;
			color: #a6a6a6;
		}
	}
</style>